from typing import Optional,List
from unittest import result
from fastapi import APIRouter
from app.utils.coordTransform_utils import bd09_to_gcj02, gcj02_to_bd09, wgs84_to_gcj02, gcj02_to_wgs84, bd09_to_wgs84, wgs84_to_bd09
import pdb
coordRouter = APIRouter(prefix="/coord", tags=['坐标转换'])


@coordRouter.get("/gcj02_to_bd09", summary="火星坐标系->百度坐标系")
async def gcj02_to_bd09_fn(lng: float, lat: float):
    result = gcj02_to_bd09(lng, lat)
    return {
        "result": result
    }
@coordRouter.get("/bd09_to_gcj02", summary="百度坐标系->火星坐标系")
async def bd09_to_gcj02_fn(lng: float, lat: float):
    result = bd09_to_gcj02(lng, lat)
    return {
        "result": result
    }
@coordRouter.get("/wgs84_to_gcj02", summary="WGS84坐标系->火星坐标系")
async def wgs84_to_gcj02_fn(lng: float, lat: float):
    result = wgs84_to_gcj02(lng, lat)
    return {
        "result": result
    }
@coordRouter.get("/gcj02_to_wgs84", summary="火星坐标系->WGS84坐标系")
async def gcj02_to_wgs84_fn(lng: float, lat: float):
    result = gcj02_to_wgs84(lng, lat)
    return {
        "result": result
    }

@coordRouter.get("/bd09_to_wgs84", summary="百度坐标系->WGS84坐标系")
async def bd09_to_wgs84_fn(lng: float, lat: float):
    result = bd09_to_wgs84(lng, lat)
    return {
        "result": result
    }
@coordRouter.get("/wgs84_to_bd09", summary="WGS84坐标系->百度坐标系")
async def wgs84_to_bd09_fn(lng: float, lat: float):
    result = wgs84_to_bd09(lng, lat)
    return {
        "result": result
    }